1
2
3
4
5
6
7
8 package org.thema;
9
10 import junit.framework.*;
11
12 /***
13 *
14 * @author Eduardo M . Sasso
15 */
16 public class UtilTest extends TestCase {
17
18 public UtilTest(String testName) {
19 super(testName);
20 }
21
22 protected void setUp() throws Exception {
23 }
24
25 protected void tearDown() throws Exception {
26 }
27
28 public static Test suite() {
29 TestSuite suite = new TestSuite(UtilTest.class);
30
31 return suite;
32 }
33
34 /***
35 * Test of getTableName method, of class org.thema.Util.
36 */
37 public void testGetTableName() {
38 String sql = "select sysdate from dual";
39 String tableName = Util.getTableName(sql);
40 assertEquals(tableName,"dual",tableName);
41
42
43
44
45
46
47
48 sql = "select object_name,created,object_type from user_objects where rownum<10";
49 tableName = Util.getTableName(sql);
50 assertEquals("user_objects",tableName);
51 }
52
53 }